package com.whmall.service.crm.provider;

import com.whmall.component.entity.dto.*;
import com.whmall.service.crm.api.CustomerPoolApi;
import com.whmall.service.crm.entity.dto.customerpool.*;
import com.whmall.service.crm.module.customerpool.service.CustomerPoolService;
import org.apache.dubbo.config.annotation.Method;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service(interfaceClass = CustomerPoolApi.class,
        methods = {@Method(name="noOrderWithinTimeLimitJobHandler", timeout = 6000000),
                @Method(name="releaseCustomerJobHandler", timeout = 6000000),
                @Method(name="list", timeout = 60000)})
public class CustomerPoolProvider implements CustomerPoolApi {

    @Autowired
    private CustomerPoolService customerPoolService;

    @Override
    public void noOrderWithinTimeLimitJobHandler(Date followTime, Date effectiveTime) {
        customerPoolService.noOrderWithinTimeLimitJobHandler(followTime, effectiveTime);
    }

    @Override
    public void releaseCustomerJobHandler(Map<Long, QueryManagerRspDTO> traders, Map<Long, Date> employeeNotices) {
        customerPoolService.releaseCustomerJobHandler(traders, employeeNotices);
    }

    @Override
    public CustomerPoolScoreTimeConfigRspDTO getScoreTimeConfig(Date now) {
        return customerPoolService.getScoreTimeConfig(now);
    }

    @Override
    public PageRspDTO<CustomerPoolListRspDTO> list(PageReqDTO pageReqDTO, CustomerPoolListReqDTO reqDTO) {
        return customerPoolService.list(pageReqDTO, reqDTO);
    }

    @Override
    public List<CustomerPoolListRspDTO> listByCompanyIds(List<Long> companyIds) {
        return customerPoolService.listByCompanyIds(companyIds);
    }

    @Override
    public Boolean chockfollowStatus(Long id) {
        return customerPoolService.chockfollowStatus(id);
    }

    @Override
    public PageRspDTO<CustomerPoolLogListRspDTO> listLog(PageReqDTO pageReqDTO, Long companyId) {
        return customerPoolService.listLog(pageReqDTO, companyId);
    }

    @Override
    public void acquire(CustomerPoolAcquireReqDTO reqDTO) {
        customerPoolService.acquire(reqDTO);
    }

    @Override
    public void createOrder(Long companyId) {
        customerPoolService.createOrder(companyId);
    }

    @Override
    public void assign(CustomerPoolAssignReqDTO reqDTO) {
        customerPoolService.assign(reqDTO);
    }

    @Override
    public void push(CustomerPoolPushReqDTO reqDTO) {
        customerPoolService.push(reqDTO);
    }

    @Override
    public void hide(UpdateBatchCommonReqDTO reqDTO) {
        customerPoolService.hide(reqDTO);
    }

    @Override
    public void noDevelopmentValue(UpdateBatchCommonReqDTO reqDTO) {
        customerPoolService.noDevelopmentValue(reqDTO);
    }

    @Override
    public void lock(UpdateCommonReqDTO reqDTO) {
        customerPoolService.lock(reqDTO);
    }

    @Override
    public PageRspDTO<CustomerPoolListFollowRspDTO> listFollow(PageReqDTO pageReqDTO, CustomerPoolListFollowReqDTO reqDTO) {
        return customerPoolService.listFollow(pageReqDTO, reqDTO);
    }

    @Override
    public PageRspDTO<CustomerPoolListMoreFollowRspDTO> listMoreFollow(PageReqDTO pageReqDTO, Long companyId) {
        return customerPoolService.listMoreFollow(pageReqDTO, companyId);
    }

    @Override
    public List<CustomerPoolExportFollowRspDTO> exportFollow(CustomerPoolExportFollowReqDTO reqDTO) {
        return customerPoolService.exportFollow(reqDTO);
    }

    @Override
    public List<Date> listTimeDistri(CustomerPoolListTimeDistriReqDTO reqDTO) {
        return customerPoolService.listTimeDistri(reqDTO);
    }

    @Override
    public void follow(CustomerPoolFollowReqDTO reqDTO) {
        customerPoolService.follow(reqDTO);
    }

    @Override
    public Long count(CustomerPoolListTimeDistriReqDTO condition) {
        return customerPoolService.count(condition);
    }

}
